#include "Wall3DStrip.h"
#include "Wall3D.h"

void Wall3DStrip::AddPoint(const MyVec3& newPoint)
{
	static bool at_least_one_point_added=false;
	
	//
	// if mWalls is empty and mpLastPointAdded, then its the 1st point we add
	// so just store the point and skip the rest
	if(mWalls.empty() && at_least_one_point_added==false)
	{
		mLastPointAdded = newPoint;
		at_least_one_point_added = true;
		return;
	}
	
	Wall3D aWall(mLastPointAdded,newPoint,mWallsHeight);
	mWalls.push_back(aWall);
	
	mLastPointAdded=newPoint;
}

//------------------------------------------------------------------------
//	set the height the walls will have
//	
//------------------------------------------------------------------------
void Wall3DStrip::SetWallsHeight(MyReal newHeight)
{
	mWallsHeight=newHeight;

	WallVector::iterator it;
	for (it=mWalls.begin(); it!=mWalls.end(); it++)
	{
		(*it).SetHeight(mWallsHeight);
	}
}